function [ah, bh] = CalculateDetPosDepCoeffs(PsiX, PsiY, detLat)

% Detector orientation gamma: bisector of the arms wrt North
gam = pi/2.0 - 0.5*(PsiX + PsiY);

% Detector position latitude (lambda)
lambda = detLat;

sin2gamma	= sin(2.0*gam);
cos2gamma	= cos(2.0*gam);
sin1lambda	= sin(lambda);
cos1lambda	= cos(lambda);

sin2lambda = 2.0 * sin1lambda * cos1lambda;
cos2lambda = cos1lambda * cos1lambda - sin1lambda * sin1lambda;

% coefficients for a(t) 
ah1 = 0.0625 * sin2gamma * (3.0 - cos2lambda);    % 1/16 = 0.0625 
ah2 = - 0.25 * cos2gamma * sin1lambda;
ah3 =   0.25 * sin2gamma * sin2lambda;
ah4 =  -0.5  * cos2gamma * cos1lambda;
ah5 =  0.75  * sin2gamma * cos1lambda * cos1lambda;
ah = [ah1, ah2, ah3, ah4, ah5];

% coefficients for b(t) 
bh1 =           cos2gamma * sin1lambda;
bh2 =   0.25 * sin2gamma * (3.0 - cos2lambda);
bh3 =           cos2gamma * cos1lambda;
bh4 =   0.5  * sin2gamma * sin2lambda;
bh = [bh1, bh2, bh3, bh4];


